﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using System.Windows.Data;
using System.Globalization;

namespace SQLVis.Presentation.View.WPF.Converters
{
    public class ColorConverter : IValueConverter
    {
        public enum Lights
        {
            GREEN,
            YELLOW,
            RED
        }

        //ColorIden --> Color
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            int colorID = (int)value;
            //Lights light = (Lights)Enum.Parse(typeof(Lights), (string)parameter);
            System.Windows.Media.Color oColor = new Color();
            //remplazar por enum
            switch (colorID)
            {
                case 1:
                    oColor = Colors.Red;
                    break;
                case 2:
                    oColor = Colors.Tomato;
                    break;
                case 3:
                    oColor = Colors.Orange;
                    break;
                default:
                    oColor = Colors.Green;
                    break;

            }
            return oColor ;
        }

        //Color --> ColorIden
        public object ConvertBack(object value, Type targetType,  object parameter, CultureInfo culture)
        {
            return 1;
        }
    }
}




